<{include file="top.html" }>
</head>
<body>
<div class="bgcolor"></div>
<div class="xy-panel">
    <div class="xy-panel-top">
        <div class="xy-titlebar">
            <div class="xy-titlebar-left">
                <a class="insertBefore_left_arrow_gray" href="javascript:void(0);"></a>
            </div>
            <div class="xy-titlebar-title">我的奖品</div>
            <div class="xy-titlebar-right"></div>
        </div>
    </div>
    <div class="xy-panel-content" style="bottom:0;">
        <{if $data}>
                <table class="jfmx_con" border="0" cellpadding="0" cellspacing="0">
                    <thead>
                    <tr>
                        <td>时间</td>
                        <td style="width:25%;">中奖结果</td>
                        <td>说明</td>
                    </tr>
                    </thead>
                    <tbody id="myPrize">
                        <{include file="User/myPrizeMore.html"}>
                    </tbody>
                </table>
                <div id="load_container">
                    <{if $isPage==1}>
                        <a href="javascript:load_more();" id="load_more"><span>加载更多</span></a><br>
                    <{else}>
                        <a href="javascript:void(0);">没有更多啦</a><br>
                    <{/if}>
                </div>
            </div>
        <{else}>
            <div class="none-box">
                <span class="gift-icon"></span>
                <dl>您还没有奖品哦～</dl>
                <!--<div class="ui-button ui-button-2">-->
                    <!--<a class="" href="../javascript:void(0);">返回首页</a>-->
                <!--</div>-->
            </div>
        <{/if}>
    </div>
</div>
<{include file="signBody.html"}>

</body>
</html>
<script>
    //拖动加载
    var  flagAjax  =  true;
    var  page      =  2;
    var type       = "<{$type}>";
    //加载
    function  load_more(){
        if(!flagAjax){
            return  false;
        }
        $("#load_more  span").html('正在加载...');
        flagAjax  =  false;
        $.post("<{u('luckyPrizeMore')}>",{page:page,type:type} , function(data){
            if(data.data)  {
                $("#myPrize").append(data.html);
                page++;
                if(data.isPage) {
                    flagAjax  =  true;
                    $("#load_more  span").html('加载更多');
                } else{
                    $("#load_more  span").html('没有更多啦');
                }
            } else {
                $("#load_container").html('<a  href="javascript:void(0);"  id="load_more"><span>没有更多啦</span></a>');
            }
        },'json');
    }
    var  tmp_scroll  =  0;
    //拖动加载
    $(".xy-panel-content").scroll(function(){
        if  (tmp_scroll  ==  $(this).height()  +  $(this).scrollTop())  {
            return;
        }
        tmp_scroll  =  $(this).height()  +  $(this).scrollTop();
        var  jia_scroll  =  $(this)[0].scrollHeight  -  tmp_scroll;
        if  (jia_scroll  <  100)  {
            load_more();
        }
    });
</script>